package org.example.cdpcrpbackend.controller;

import lombok.RequiredArgsConstructor;
import org.example.cdpcrpbackend.controller.dto.Result;
import org.example.cdpcrpbackend.domain.CrpModule;
import org.example.cdpcrpbackend.service.CrpModuleService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/crp-module")
@RequiredArgsConstructor
public class CrpModuleController {
    private final CrpModuleService service;

    /**
     * 申请-获取所有模块
     */
    @GetMapping
    public Result list() {
        List<CrpModule> list = service.list();
        return Result.success(list);
    }
}
